# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=Net-HTTP
pkgname=perl-${_realname}
pkgver=6.18
pkgrel=1
pkgdesc="Low-level HTTP connection (client)"
arch=('any')
url="http://search.cpan.org/dist/Net-HTTP"
groups=('perl-modules')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl>=5.6.2')
conflicts=('perl-libwww<6')
source=("https://www.cpan.org/authors/id/O/OA/OALDERS/${_realname}-${pkgver}.tar.gz")
sha256sums=('7e42df2db7adce3e0eb4f78b88c450f453f5380f120fd5411232e03374ba951c')

build() {
  export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
    PERL_AUTOINSTALL=--skipdeps                            \
    PERL_MM_OPT="INSTALLDIRS=vendor"     \
    PERL_MB_OPT="--installdirs vendor" \
    MODULEBUILDRC=/dev/null

  cd ${_realname}-${pkgver}
  /usr/bin/perl Makefile.PL
  make
}

check() {
  export PERL_MM_USE_DEFAULT=1 PERL5LIB=""
  cd ${_realname}-${pkgver}
  make test
}

package() {
  cd ${_realname}-${pkgver}
  make DESTDIR="${pkgdir}" install
}
